package com.lagou.controller;

import com.lagou.service.MailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/email")
public class MailController {

    @Autowired
    private MailService mailService;

    @RequestMapping("/{email}/{code}")
    public String senMail(@PathVariable("email") String email, @PathVariable("code") String code) {
        mailService.send(email, code);
        return "发送成功！";
    }
}
